<template>
    <div class="container">
        <!-- 位置 -->
        <div class="position-x mt20 flex-align">
            <span>您的位置：首页</span>
            <span>></span>
            <span>游戏</span>
        </div>
        <!--  -->
        <div class="collection-nav flex-center-align mt20">
            <div class="flex-center-align collection-nav-li fz24" :class="navCurrent == index ? 'active' : ''"
                @click="navClick(item, index)" v-for="(item, index) in navList" :key="item.id">
                <span>{{ item.name }}</span>
            </div>
        </div>
        <div class="collection-list">
            <ul class="ovn">
                <li v-for="(item, index) in 8" :key="item">
                    <h3>出行软件合集</h3>
                    <div class="collection-la flex">
                        <div class="collection-la-img">
                            <img class="img100" src="~/assets/images/img.png" alt="">
                        </div>
                        <div class="collection-la-info flex1 ovn">
                            <p class="collection-la-info-top fz12 ellipsis3">
                                行，是生活中不可游免的事情。也是因为人民生水平的提高，各种软件的开发和道路车辆的增多，让我们不得不提前</p>
                            <div class="collection-la-info-bottom flex-align">
                                <span class="fz12 flex1">更新时间：2019-06-03</span>
                                <span class="flex-center-align fz14 cfff">共18款</span>
                            </div>
                        </div>
                    </div>
                    <dl class="collection-la-list">
                        <dd class="ovn" v-for="(item, index) in 5" :key="item">
                            <img class="img100" src="~/assets/images/img.png" alt="">
                        </dd>
                    </dl>
                </li>
            </ul>
        </div>
        <!--  -->
        <div class="box10 pt16 pb16 flex-center-align mt20">
            <el-pagination background layout="prev, pager, next" v-model:current-page="params.page"
                :page-size="params.size" :total="total" @current-change="handleCurrentChange" />
        </div>
        <!--  -->
    </div>
</template>
<script setup>
/* 关键词描述 */
let pageInfo = useWebsiteStore().getgetMenuInfo('文章');// 调用 store 实例的方法
useSeoMeta({
    title: () => pageInfo.page_title,
    keywords: () => pageInfo.page_keywords,
    description: () => pageInfo.page_description,
})
let navList = ref([
    { id: 0, name: '全部' },
    { id: 1, name: '游戏合集' },
    { id: 2, name: '软件合集' },
    { id: 3, name: 'H5合集' },
])
let navCurrent = ref(0);
let params = reactive({
    id: '',
    page: 1,
    limit: 10,
})
let total = ref(0);
let dataList = ref([]);

//切换页码时变化
const handleCurrentChange = (val) => {
    params.page = val;
    getList();
}
</script>
<style lang="scss" scoped>
.position-x {
    position: relative;
    padding: 0 22px;
    height: 44px;
    background: #FFFFFF;
    font-size: 14px;
    color: #626262;
}

.collection-nav {
    .collection-nav-li {
        position: relative;
        margin-right: 24px;
        width: 156px;
        height: 60px;
        background: #D9D9D9;
        cursor: pointer;

        &:last-child {
            margin-right: 0;
        }

        &.active {
            background-color: #FF8E2B;
            color: #ffffff;
        }
    }
}

.collection-list {
    padding-left: 20px;

    li {
        position: relative;
        float: left;
        margin: 20px 20px 0 0;
        padding: 16px;
        width: 373px;
        height: 215px;
        background: #FFFFFF;
        border-radius: 10px;

        h3 {
            font-weight: bold;
            font-size: 18px;
            color: #333333;
            line-height: 27px;
        }

        .collection-la {
            margin-top: 12px;

            .collection-la-img {
                width: 132px;
                height: 74px;
            }

            .collection-la-info {
                margin-left: 10px;

                .collection-la-info-top {
                    line-height: 16px;
                    height: 48px;
                    overflow: hidden;
                }

                .collection-la-info-bottom {
                    span {
                        &:nth-child(1) {}

                        &:nth-child(2) {
                            width: 65px;
                            height: 25px;
                            background: #FF8E2B;
                            border-radius: 2px;
                        }
                    }
                }
            }
        }

        .collection-la-list {
            position: relative;
            padding-top: 12px;
            overflow: hidden;

            dd {
                float: left;
                margin-right: 10px;
                width: 60px;
                height: 60px;
                border-radius: 9px;
                overflow: hidden;

                &:last-child {
                    margin-right: 0;
                }
            }
        }
    }
}
</style>